home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
man
/
cat.n
/
focus.n
< prev
next >
Wrap
Text File
|
1995-07-25
|
10KB
|
199 lines
ffffooooccccuuuussss((((nnnn)))) TTTTkkkk (((( )))) ffffooooccccuuuussss((((nnnn))))
_________________________________________________________________
NNNNAAAAMMMMEEEE
focus - Direct keyboard events to a particular window
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
ffffooooccccuuuussss
ffffooooccccuuuussss _w_i_n_d_o_w
ffffooooccccuuuussss _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
_________________________________________________________________
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
The ffffooooccccuuuussss command is used to manage the Tk input focus. At |
any given time, one window in an application is designated |
as the focus window for that application; any key press or |
key release events directed to any window in the application |
will be redirected instead to the focus window. If there is |
no focus window for an application then keyboard events are |
discarded. Typically, windows that are prepared to deal |
with the focus (e.g. entries and other widgets that display |
editable text) will claim the focus when mouse button 1 is |
pressed in them. When an application is created its main |
window is initially given the focus. |
The ffffooooccccuuuussss command can take any of the following forms: |
ffffooooccccuuuussss ||
If invoked with no arguments, ffffooooccccuuuussss returns the path |
name of the current focus window, or nnnnoooonnnneeee if there is |
no focus window. |
ffffooooccccuuuussss _w_i_n_d_o_w ||
If invoked with a single argument consisting of a |
window's path name, ffffooooccccuuuussss sets the input focus to that |
window. The return value is an empty string. |
ffffooooccccuuuussss ddddeeeeffffaaaauuuulllltttt ?_w_i_n_d_o_w? ||
If _w_i_n_d_o_w is specified, it becomes the default focus |
window (the window that receives the focus whenever the |
focus window is deleted) and the command returns an |
empty string. If _w_i_n_d_o_w isn't specified, the command |
returns the path name of the current default focus |
window, or nnnnoooonnnneeee if there is no default. _W_i_n_d_o_w may be |
specified as nnnnoooonnnneeee to clear its existing value. The |
default window is initially nnnnoooonnnneeee. |
ffffooooccccuuuussss nnnnoooonnnneeee ||
Clears the focus window, so that keyboard input to this |
application will be discarded. |
Page 1 (printed 7/23/95)
ffffooooccccuuuussss((((nnnn)))) TTTTkkkk (((( )))) ffffooooccccuuuussss((((nnnn))))
FFFFOOOOCCCCUUUUSSSS EEEEVVVVEEEENNNNTTTTSSSS ||||
Tk's model of the input focus is different than X's model, |
and the focus window set with the ffffooooccccuuuussss command is not |
usually the same as the X focus window. Tk never explicitly |
changes the official X focus window. It waits for the |
window manager to direct the X input focus to and from the |
application's top-level windows, and it intercepts FFFFooooccccuuuussssIIIInnnn |
and FFFFooooccccuuuussssOOOOuuuutttt events coming from the X server to detect these |
changes. All of the focus events received from X are |
discarded by Tk; they never reach the application. |
Instead, Tk generates a different stream of FFFFooooccccuuuussssIIIInnnn and |
FFFFooooccccuuuussssOOOOuuuutttt for the application. This means that FFFFooooccccuuuussssIIIInnnn and |
and FFFFooooccccuuuussssOOOOuuuutttt events seen by the application will not obey |
the conventions described in the documentation for Xlib. |
Tk applications receive two kinds of FFFFooooccccuuuussssIIIInnnn and FFFFooooccccuuuussssOOOOuuuutttt |
events, which can be distinguished by their _d_e_t_a_i_l fields. |
Events with a _d_e_t_a_i_l of NNNNoooottttiiiiffffyyyyAAAAnnnncccceeeessssttttoooorrrr are directed to the |
current focus window when it becomes active or inactive. A |
window is the active focus whenever two conditions are |
simultaneously true: (a) the window is the focus window for |
its application, and (b) some top-level window in the |
application has received the X focus. When this happens Tk |
generates a FFFFooooccccuuuussssIIIInnnn event for the focus window with detail |
NNNNoooottttiiiiffffyyyyAAAAnnnncccceeeessssttttoooorrrr. When a window loses the active focus |
(either because the window manager removed the focus from |
the application or because the focus window changed within |
the application) then it receives a FFFFooooccccuuuussssOOOOuuuutttt event with |
detail NNNNoooottttiiiiffffyyyyAAAAnnnncccceeeessssttttoooorrrr. |
The events described above are directed to the application's |
focus window regardless of which top-level window within the |
application has received the focus. The second kind of |
focus event is provided for applications that need to know |
which particular top-level window has the X focus. Tk |
generates FFFFooooccccuuuussssIIIInnnn and FFFFooooccccuuuussssOOOOuuuutttt events with detail |
NNNNoooottttiiiiffffyyyyVVVViiiirrrrttttuuuuaaaallll for top-level windows whenever they receive or |
lose the X focus. These events are generated regardless of |
which window in the application has the Tk input focus. |
They do not imply that keystrokes will be directed to the |
window that receives the event; they simply indicate which |
top-level window is active as far as the window manager is |
concerned. If a top-level window is also the application's |
focus window, then it will receive both NNNNoooottttiiiiffffyyyyVVVViiiirrrrttttuuuuaaaallll and |
NNNNoooottttiiiiffffyyyyAAAAnnnncccceeeessssttttoooorrrr events when it receives or loses the X focus. |
Tk does not generate the hierarchical chains of FFFFooooccccuuuussssIIIInnnn and |
FFFFooooccccuuuussssOOOOuuuutttt events described in the Xlib documentation (e.g. a |
window can get a FFFFooooccccuuuussssIIIInnnn or FFFFooooccccuuuussssOOOOuuuutttt event without all of |
its ancestors getting events too). Furthermore, the _m_o_d_e |
field in focus events is always NNNNoooottttiiiiffffyyyyNNNNoooorrrrmmmmaaaallll and the only |
values ever present in the _d_e_t_a_i_l field are NNNNoooottttiiiiffffyyyyAAAAnnnncccceeeessssttttoooorrrr |
Page 2 (printed 7/23/95)
ffffooooccccuuuussss((((nnnn)))) TTTTkkkk (((( )))) ffffooooccccuuuussss((((nnnn))))
and NNNNoooottttiiiiffffyyyyVVVViiiirrrrttttuuuuaaaallll.
KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
events, focus, keyboard, top-level, window manager
Page 3 (printed 7/23/95)